<?php
include_once '../cache/htmlCache.php';
include_once '../class/psnClan.class.php';

$PSLogURL = "https://store.playstation.com/external/index.vm?returnURL=";
$ThisURL = "http://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"];

if (isset($_GET['sessionId'])) {
	set_time_limit(0);
	$c = new HtmlCache("../cache/cached",".html", 900);//caching the page, refresh 15min
	$section = $c->Create(FLAGS_NONE, 900);
	if($section->GetType() == CACHE_CREATED){
		$myClan = new psnClan($_GET['sessionId']);
		$myClan->loadRankingTrophies();
		$myClan->echoTrophiesFriends();
	}
	$section->Stop();
}

else
	header ("Location: " . $PSLogURL . $ThisURL);
?>


